const express=require('express');
const phoneService=require('../services/phoneService');

var router=express.Router();

router.use('/shop/data',async (req,res,next)=>{
    //找出所有phone
    var GET=req.query;
    var kind=GET.kind;
    if(kind==undefined||kind==null||kind=={}||kind==[]){
        kind='iphone';
    };
    var data=await phoneService.findByKind(kind);
    res.send(data);
})


exports.router=router;